<?php

namespace admin\helper;

class currency extends common
{
    /**
     * 获取货币列表
     * @return mixed
     */
    public function lists()
    {
        $data = $this->db->pageSelect('currency', '*', ['ORDER' => ['currency_id' => "DESC"]], 20);
        return $data;
    }

    /**
     * 获取单个货币信息
     * @param $id       货币ID
     * @return mixed
     */
    public function getOne($id)
    {
        return $this->db->get('currency', '*', ['currency_id' => $id]);
    }

    /**
     * 添加货币信息
     * @param $data     货币数据
     * @return mixed
     */
    public function addCurrency($data)
    {
        $ret = $this->db->insert('currency', $data);
        return $ret;
    }

    /**
     * 更新货币信息
     * @param $data     货币数据
     * @param $map
     */
    public function updateCurrency($data, $map)
    {
        $this->db->update('currency', $data, $map);
    }
}